/**
 * 作者: lipengfei
 * 日期: 2021-12-23 19:43:51
 * 备注: 充值礼包表
 */
package com.motu.monstercity.module.common.iap;

import io.vertx.core.json.JsonObject;

public class IapGiftModel {
    protected int id; // 数据库id
    protected int type; // 类型
    protected int iapId; // 充值项id
    protected String areaIapId; // 不同区域替换iap_id (Json{"区域码":替换的IapId})
    protected int diamond; // 获得钻石
    protected String reward; // 其他奖励
    protected int limitType; // 限制类型
    protected int limitNum; // 限制值
    protected String param; // 特殊参数
    protected int duration; // 持续时间
    protected String limitLevel; // 限制等级
    protected int chargeType; // 数数标记类型

    public IapGiftModel() {
    }

    public IapGiftModel(JsonObject obj) {
        id = obj.containsKey("id") ? obj.getInteger("id") : 0;
        type = obj.containsKey("type") ? obj.getInteger("type") : 0;
        iapId = obj.containsKey("iap_id") ? obj.getInteger("iap_id") : 0;
        areaIapId = obj.containsKey("area_iap_id") ? obj.getString("area_iap_id") : "";
        diamond = obj.containsKey("diamond") ? obj.getInteger("diamond") : 0;
        reward = obj.containsKey("reward") ? obj.getString("reward") : "";
        limitType = obj.containsKey("limit_type") ? obj.getInteger("limit_type") : 0;
        limitNum = obj.containsKey("limit_num") ? obj.getInteger("limit_num") : 0;
        param = obj.containsKey("param") ? obj.getString("param") : "";
        duration = obj.containsKey("duration") ? obj.getInteger("duration") : 0;
        limitLevel = obj.containsKey("limit_level") ? obj.getString("limit_level") : "";
        chargeType = obj.containsKey("charge_type") ? obj.getInteger("charge_type") : 0;
    }

    public int getId() {
        return id;
    }

    public int getType() {
        return type;
    }

    public int getIapId() {
        return iapId;
    }

    public String getAreaIapId() {
        return areaIapId;
    }

    public int getDiamond() {
        return diamond;
    }

    public String getReward() {
        return reward;
    }

    public int getLimitType() {
        return limitType;
    }

    public int getLimitNum() {
        return limitNum;
    }

    public String getParam() {
        return param;
    }

    public int getDuration() {
        return duration;
    }

    public String getLimitLevel() {
        return limitLevel;
    }

    public int getChargeType() {
        return chargeType;
    }

}
